add_library(mock_ls_tablet_service SHARED
  mock_ls_tablet_service.cpp)
target_link_libraries(mock_ls_tablet_service PUBLIC oceanbase)

add_library(mock_access_service SHARED
  mock_access_service.cpp)
target_link_libraries(mock_access_service PUBLIC oceanbase)

function(storage_unittest case)
  ob_unittest(${ARGV})
  target_link_libraries(${case} PRIVATE mockcontainer)
endfunction()

function(storage_dml_unittest case)
  ob_unittest(${ARGV})
  target_link_libraries(${case} PRIVATE mockcontainer mock_ls_tablet_service mock_access_service)
endfunction()

add_subdirectory(mockcontainer)
add_subdirectory(transaction)
add_subdirectory(tx)
add_subdirectory(blocksstable)
add_subdirectory(direct_load)
add_subdirectory(utl_file)
add_subdirectory(tx_table)
add_subdirectory(ddl)

storage_unittest(test_io_manager)
storage_unittest(test_iocb_pool)
storage_unittest(test_ob_col_map)
storage_unittest(test_placement_hashmap)
storage_unittest(test_parallel_external_sort)
storage_unittest(test_i_store)
storage_unittest(test_sstable_merge_info_mgr)
#storage_unittest(test_row_sample_iterator)
#storage_unittest(test_table_store_stat_mgr)
storage_unittest(test_tenant_tablet_stat_mgr)
#storage_unittest(test_dag_size)
storage_unittest(test_handle_cache)
#storage_unittest(test_log_replay_engine replayengine/test_log_replay_engine.cpp)
storage_unittest(test_hash_performance)
storage_unittest(test_row_fuse)
#storage_unittest(test_keybtree memtable/mvcc/test_keybtree.cpp)
storage_unittest(test_query_engine memtable/mvcc/test_query_engine.cpp)
storage_unittest(test_memtable_basic memtable/test_memtable_basic.cpp)
storage_unittest(test_mvcc_callback memtable/mvcc/test_mvcc_callback.cpp)
# storage_unittest(test_mds_compile multi_data_source/test_mds_compile.cpp)
storage_unittest(test_mds_list multi_data_source/test_mds_list.cpp)
storage_unittest(test_mds_node multi_data_source/test_mds_node.cpp)
# storage_unittest(test_mds_row multi_data_source/test_mds_row.cpp)
# storage_unittest(test_mds_unit multi_data_source/test_mds_unit.cpp)
storage_unittest(test_mds_table multi_data_source/test_mds_table.cpp)
storage_unittest(test_mds_table_flush multi_data_source/test_mds_table_flush.cpp)
storage_unittest(test_mds_dump_kv multi_data_source/test_mds_dump_kv.cpp)
#storage_unittest(test_multiple_merge)
#storage_unittest(test_memtable_multi_version_row_iterator memtable/test_memtable_multi_version_row_iterator.cpp)
#storage_unittest(test_new_table_store)
storage_unittest(test_mds_table_handle multi_data_source/test_mds_table_handle.cpp)
storage_unittest(test_fixed_size_block_allocator)
storage_unittest(test_dag_warning_history)
storage_unittest(test_storage_schema)
#storage_unittest(test_storage_schema_mgr)
#storage_unittest(test_create_tablet_memtable test_create_tablet_memtable.cpp)
storage_unittest(test_tenant_meta_obj_pool test_tenant_meta_obj_pool.cpp)
storage_unittest(test_meta_pointer_map test_meta_pointer_map.cpp)
storage_unittest(test_storage_logger_manager slog/test_storage_logger_manager.cpp)
storage_unittest(test_storage_log_read_write slog/test_storage_log_read_write.cpp)
storage_unittest(test_storage_log_replay slog/test_storage_log_replay.cpp)
storage_unittest(test_linked_macro_block slog_ckpt/test_linked_macro_block.cpp)
storage_unittest(test_tablet_dumped_medium_info test_tablet_dumped_medium_info.cpp)
#storage_unittest(test_log_stream_backup backup/test_log_stream_backup.cpp)
#storage_unittest(test_backup_ctx backup/test_backup_ctx.cpp)
storage_unittest(test_backup_utils backup/test_backup_utils.cpp)
storage_unittest(test_backup_tmp_file backup/test_backup_tmp_file.cpp)
storage_unittest(test_backup_data_struct backup/test_backup_data_struct.cpp)
storage_unittest(test_backup_index_cache backup/test_backup_index_cache.cpp)
storage_unittest(test_backup_iterator backup/test_backup_iterator.cpp)
storage_unittest(test_backup_index_merger backup/test_backup_index_merger.cpp)
storage_unittest(test_backup_extern_info_mgr backup/test_backup_extern_info_mgr.cpp)

#storage_unittest(test_create_tablet_clog tx_storage/test_create_tablet_clog.cpp)
storage_unittest(test_simple_rows_merger)
storage_unittest(test_partition_incremental_range_spliter)
storage_unittest(test_partition_major_sstable_range_spliter)
storage_unittest(test_parallel_minor_dag)
storage_dml_unittest(test_partition_range_splite)
storage_dml_unittest(test_major_rows_merger)
storage_dml_unittest(test_tablet tablet/test_tablet.cpp)

#storage_dml_unittest(test_table_scan_pure_index_table)

storage_unittest(test_sstable_log_ts_range_cut test_sstable_log_ts_range_cut.cpp)
